<%@page import="org.swim.remote.entities.IUser"%>
<%@page import="org.swim.remote.entities.IMessage"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="org.swim.web.utils.*"%>
<%@page import="java.util.List"%>	

<%
	List messages = (List)request.getAttribute("messages");
	IUser owner = (IUser)request.getAttribute("owner");
	IMessage mex;
	for (int i = 0; i < messages.size(); i++) {
		mex = (IMessage)messages.get(i);
%>

<p class="baloon medium-text" style="padding-bottom: 17px" data-ts="<%= mex.getTimestamp().getTime() %>">
	
	<% if(mex.getIUserBySenderId() != null && mex.getIUserBySenderId().equals(owner)){ %>
	<span class="label">You say:</span>
	<% }else{ %>
	<span class="label">Collaborator says:</span>
	<%} %>
	<%= mex.getMessage() %>
	<span
		class="pull-right small-text muted"><%=SwimUtils.formatDate(mex.getTimestamp(),
						"dd/MM/yyyy, HH:mm") %></span>
</p>
<%
	}
%>